package com.workcell.workdata.xthings.controller;

import com.workcell.workdata.common.core.util.R;
import com.workcell.workdata.common.security.annotation.Inner;
import com.workcell.workdata.xthings.mapper.CommonMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @Author guoyu
 * @Date 2023/6/6 9:17
 * @Description common
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/common" )
@Api(value = "common", tags = "公共接口")
public class CommonController {

	private final CommonMapper mapper;

	@Inner
	@ApiOperation(value = "uh:查询超出阈值异常设备总数", notes = "uh:查询超出阈值异常设备总数")
	@GetMapping("/nhUnusableDeviceSum" )
	public R<Integer> nhUnusableDeviceSum(@RequestParam("time")String time, @RequestParam("hardwareType")String hardwareType){
		return R.ok(mapper.nhUnusableDeviceSum(time, hardwareType));
	}

	@Inner
	@ApiOperation(value = "qm:查询超出阈值异常设备总数", notes = "qm:查询超出阈值异常设备总数")
	@GetMapping("/qmUnusable" )
	public R<Integer> qmUnusable(){
		return R.ok(mapper.qmUnusable());
	}
}
